package com.sishu.websocket4.controller;

import cn.dev33.satoken.util.SaResult;
import com.sishu.websocket4.service.Userservice;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 登录测试 
 */
@RestController
@RequestMapping("/acc/")
@CrossOrigin(origins = "*")
public class LoginController {

	@Resource
	private Userservice userService;

	// 测试登录  ---- http://localhost:8081/acc/doLogin?name=zhang&pwd=123456
    @PostMapping("register")
	public SaResult register(@Param("username") String username, @Param("password") String password, @Param("uid")String uid,@Param("type")String type) {

		SaResult saResult = userService.register(username, password, uid,type);
		return saResult;
	}



}	
